home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __HFSBACKINGSTORE__
- #define __HFSBACKINGSTORE__
-
- //
- // For class definition of TAbstractBackingStore,
- // base class of THFSBackingStore
- //
- #include "DatabaseDocument.h"
-
- //
- // For class definition of TFSSpecification,
- // a field of THFSBackingStore
- //
- #include "FSSpecification.h"
-
- //
- // What is a good cookie to indicate 'file closed'?
- //
- enum
- {
- kFileNotOpen = -1
- };
-
- #define kDBCreator 'db++'
- #define kDBType 'db '
- #define kHFSBackingStore 'hfs '
-
- //================================================================================
- // Class THFSBackingStore
- //================================================================================
- class THFSBackingStore : public TAbstractBackingStore
- {
- private:
- TFSSpecification fFileSpec;
- TOpenFileRefNum fRefNum;
- Int64 fFileEOF;
- OSType fFileCreator;
- OSType fFileType;
-
- public:
- THFSBackingStore();
- THFSBackingStore(TFSSpecification& fileSpec);
- THFSBackingStore(TFSSpecification& fileSpec, OSType fileCreator, OSType fileType);
- virtual ~THFSBackingStore();
-
- virtual long BackingStoreType() const;
-
- virtual Boolean CanSaveDocument();
-
- virtual void Read(void* bufferStart, Int64 startByteInFile, long numberOfBytes);
- virtual void Write(void* bufferStart, Int64 startByteInFile, long numberOfBytes);
-
- virtual void DocumentName(TUpdataDataReference& name);
-
- TFSSpecification FileSpec() { return fFileSpec; }
-
- protected:
- void OpenFile();
- void CloseFile();
- };
-
- #endif
-